<%--
  Created by IntelliJ IDEA.
  User: MAOQIN
  Date: 2020/4/29
  Time: 23:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>叶子微客</title>
    <link rel="icon" href="/app/sea.ico"/>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="/script/inHome.js"></script>
    <link rel="stylesheet" href="/script/inHome.css"/>
</head>
<body onload="changeLeftNavColor(${leftNav})">
<!-- 导航栏 -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <a href="#" class="navbar-brand">叶子迷你微客</a>
        </div>
        <div>
            <form class="navbar-form navbar-left" role="search" action="#" method="post" onsubmit="return false">
                <div class=" form-group has-feedback">
                    <span id="icon" class="form-control-feedback glyphicon glyphicon-search"></span>
                    <input type="text" id="search" class="form-control" placeholder="搜索" name="key"
                           onkeypress="searchArticle(event.keyCode||event.which)"
                           onkeydown="searchArticle(event.keyCode||event.which)">
                    <div style="display:inline-block;width:30px;height:35px;position:absolute;right:2px;z-index:100;cursor: pointer;"
                         onmouseenter="enterSearchIcon('icon','enter')" onmouseout="enterSearchIcon('icon','out')" ;
                         onclick="searchArticle(13)"></div>
                </div>
            </form>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="/in/home?leftNav=1"><span class="glyphicon glyphicon-home"></span>首页 </a></li>
                <li><a href="#" id="navRegister"><span class="glyphicon glyphicon-user"></span> ${user.name}</a></li>
                <li><a href="/in/logout" id="navLogin" onclick="return isLogout()">
                    <span class="glyphicon glyphicon-log-out"></span> 退出</a>
                </li>
            </ul>
        </div>
    </div>
</nav>
<!-- 主页面 -->
<div class="container" style="margin-top: 1%; width: auto">
    <div class="row" style="margin-right: -1%;margin-left: -1%;">
        <div class="col-md-3 column">
            <!--左边导航栏-->
            <div class="well sidebar-nav">
                <ul class="nav nav-list">
                    <li id="li1" class="active">
                        <a href="/in/home?leftNav=1">首页</a></li>
                    <li id="li2">
                        <a href="/in/home?leftNav=2">我的收藏</a></li>
                    <li id="li3">
                        <a href="/in/home?leftNav=3">我的点赞</a></li>
                    <li class="divider"></li>
                    <li id="li4">
                        <a href="/in/home?leftNav=4">我的相册</a></li>
                    <li id="li5">
                        <a href="/in/home?leftNav=5">个人资料</a></li>
                    <c:if test="${user.type.equalsIgnoreCase('管理员')}">
                        <li class="divider"></li>
                        <li id="li10086">
                            <a href="/in/home?leftNav=10086">用户管理</a></li>
                        <li id="li1008611">
                            <a href="/in/home?leftNav=1008611">关键词管理</a></li>
                    </c:if>
                </ul>
            </div><!--/.well -->
        </div>
        <c:choose>
        <c:when test="${(leftNav lt 5) and (leftNav gt 0)}">
            <!-- 中间的界面 -->
            <div class="col-md-5 column home_center">
                <c:if test="${leftNav eq 1}">
                    <!-- 分享框 -->
                    <div class="shareDiv home_center_block">
                        <form action="/article/share" method="post" enctype="multipart/form-data"
                              onsubmit="return inputInvailds('${user.userId}')">
                            <p style="padding-top: 2%;margin-left: 5%;"><em>向大家分享你的故事吧</em></p>
                            <textarea maxlength="300" style="margin-left:1%; height: 100px;width: 98%"
                                      id="shareContent" name="content"
                                      title="微客分享输入框"
                                      oninvalid="setCustomValidity('分享的内容不能为空')"></textarea>
                            <input id="loadPic" type="file" name="imgFile" multiple
                                   accept="image/png,image/jpeg,image/jpg" value="选择"
                                   style="display: none" onchange="viewImage(this)"/>
                            <a title="图片（最多上传6张图片）" onclick="image_click()"
                               style="margin-left: 2%;cursor: pointer">
                                <span class="glyphicon glyphicon-picture" style="color: rgb(255, 140, 60)"></span>
                                图片
                            </a>
                            <select style="margin-top: 0.4%;border-width:0px;outline: none;"
                                    onchange="changeAuthority(this)">
                                <option title="所有人可见-分享的内容可以被大家公开查看哦" value="0">所有人可见</option>
                                <option title="仅自己可见-分享的内容仅自己可见哦" value="1">仅自己可见</option>
                            </select>
                            <input type="hidden" id="authority" name="authority" value="0">
                            <div id="sharePicGroup" style="display: inline">
                                <img id="preview1" name="preview" width=-1 height=-1 title="双击删除图片"
                                     ondblclick="picDbClick(this)" style="display:none;margin-left: 1%"/>
                                <img id="preview2" name="preview" width=-1 height=-1 title="双击删除图片"
                                     ondblclick="picDbClick(this)" style="display:none"/>
                                <img id="preview3" name="preview" width=-1 height=-1 title="双击删除图片"
                                     ondblclick="picDbClick(this)" style="display:none"/>
                                <img id="preview4" name="preview" width=-1 height=-1 title="双击删除图片"
                                     ondblclick="picDbClick(this)"
                                     style="display:none;margin-top: 5px;margin-left: 1%;"/>
                                <img id="preview5" name="preview" width=-1 height=-1 title="双击删除图片"
                                     ondblclick="picDbClick(this)" style="display:none;margin-top: 5px"/>
                                <img id="preview6" name="preview" width=-1 height=-1 title="双击删除图片"
                                     ondblclick="picDbClick(this)" style="display:none;margin-top: 5px"/>
                                <input type="hidden" id="imgCount" name="imgCount" value="0">
                                <input type="hidden" id="shareId" name="shareId" value="${user.userId}">
                            </div>

                            <button type="submit" style="margin-left: 90%;margin-bottom: 1%"
                                    class="btn btn-danger" title="分享按钮">分享
                            </button>
                        </form>
                    </div>
                </c:if>
                <c:if test="${(leftNav eq 2) and (articleList.size() eq 0)}">
                    <div class="share home_center_block"
                         style="margin-top: -2.7%;opacity: 100%;height: 150px">
                        <h3 style="text-align:center;padding-top: 15px;"><em>没有收藏任何文章！<br/>
                            可以<a href="/in/home?leftNav=1">前往主页</a>点击收藏自己喜欢或感兴趣的文章，就会出现在这里哦</em></h3>
                    </div>
                </c:if>
                <c:if test="${(leftNav eq 3) and (articleList.size() eq 0)}">
                    <div class="share home_center_block"
                         style="margin-top: -2.7%;opacity: 100%;height: 150px">
                        <h3 style="text-align:center;padding-top: 15px;"><em>没有点赞过任何文章！<br/>
                            可以<a href="/in/home?leftNav=1">前往主页</a>为自己喜欢或感兴趣的文章点个赞，点过赞的都会出现在这里哦</em></h3>
                    </div>
                </c:if>
                <c:if test="${(leftNav eq 4) and (articleList.size() eq 0)}">
                    <div class="share home_center_block"
                         style="margin-top: -2.7%;opacity: 100%;height: 150px">
                        <h3 style="text-align:center;padding-top: 15px;"><em>没有分享过动态哦！<br/>
                            快<a href="/in/home?leftNav=1">前往主页</a>分享自己的精彩瞬间把！</em></h3>
                    </div>
                </c:if>
                <!-- 分享内容 -->
                <div class="home_center_block_share" style="margin-top: -2%">
                    <c:if test="${leftNav eq 1 and articleList.size() eq 0}">
                        <div class="share" style="margin-top: 2%;opacity: 100%;height: 100px;">
                            <h3 style="text-align:center;padding-top: 35px">当前暂无分享，快分享你自己的精彩瞬间吧！</h3>
                        </div>
                    </c:if>
                    <c:forEach items="${articleList}" var="article" varStatus="outStatus">
                        <c:if test="${not (((article.authority eq 1) and (article.sharedUser.userId ne user.userId))
                            or ((leftNav eq 1) and shieldList.contains(article.articleId)) or (leftNav ne 4 and article.sharedUser.isAllowShare.equalsIgnoreCase('F')))}">
                            <div id="share_${article.articleId}" class="share" style="margin-top: 2%;opacity: 100%">
                                <div class="share_head" style="width: 60px;height: 60px">
                                    <div style="height: 35%;"></div>
                                    <a href="" title="${article.sharedUser.name}"
                                       style="margin-left:25%;display: inline">
                                        <img class="img-circle"
                                             src="${article.sharedUser.headPictureUrl.substring(article.sharedUser.headPictureUrl.lastIndexOf("/head/"))}"
                                             width="60" height="60"
                                             alt="${article.sharedUser.name}" style="display: inline">
                                    </a>
                                </div>
                                <div class="share_right dropdown"
                                     style="display: inline;margin: -6% 5% 0% 70%;float: right;">
                                    <a id="dropDownMenu" class="dropdown-toggle" data-toggle="dropdown"
                                       style="cursor: pointer">
                                    <span class="glyphicon glyphicon-chevron-down">
                                    </span>
                                    </a>
                                    <c:choose>
                                        <c:when test="${user.userId eq article.sharedUser.userId}">
                                            <ul class="dropdown-menu pull-right" role="menu"
                                                aria-labelledby="dropDownMenu">
                                                <li role="presentation">
                                                    <a role="menuitem" tabindex="-1" style="cursor: pointer;"
                                                       onclick="deleteShare('${article.articleId}',this)">删除</a>
                                                </li>
                                                <li role="presentation">
                                                    <a role="menuitem" tabindex="-1" style="cursor: pointer;"
                                                       onclick="updateAuthority('${article.articleId}',1)">转化为仅自己可见</a>
                                                </li>
                                                <li role="presentation">
                                                    <a role="menuitem" tabindex="-1" style="cursor: pointer;"
                                                       onclick="updateAuthority('${article.articleId}',0)">转化为所有人可见</a>
                                                </li>
                                            </ul>
                                        </c:when>
                                        <c:otherwise>
                                            <ul class="dropdown-menu pull-right" role="menu"
                                                aria-labelledby="dropDownMenu">
                                                <li role="presentation">
                                                    <a role="menuitem" tabindex="-1"
                                                       onclick="shieldShare('${article.articleId}','${user.userId}','share_${article.articleId}')">屏蔽这条分享</a>
                                                </li>
                                            </ul>
                                            <input type="hidden" value="${user.userId}">
                                            <input type="hidden" value="${article.sharedUser.userId}">
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                                <div class="share_detail" style="margin-left: 13%;margin-top:-5%">
                                    <p id="name_and_authority_${article.articleId}" title="${article.sharedUser.name}"
                                       style="font-weight: bold">${article.sharedUser.name}
                                        <c:if test="${article.authority eq 1}">
                                            <span class="glyphicon glyphicon-lock" style="color: red"></span>
                                        </c:if>
                                    </p>
                                    <a style="cursor: pointer;" onclick="turnInArticle('${article.articleId}')">
                                        <small title="${article.releaseTime}">${article.releaseTime}</small>
                                    </a>
                                    <p style="display: block;margin-top: 1%;font-size: 16px;">${article.content}</p>
                                    <c:forEach items="${article.pictureList}" var="picture">
                                        <img src="${picture.url.substring(picture.url.lastIndexOf('/'))}" width="150px"
                                             height="120px" style="display: inline;margin: 0.5%">
                                    </c:forEach>
                                </div>
                                <hr style="margin-bottom: 0px;"/>
                                <div class="share_handle" style="margin-top: 2%;font-size: 15px">
                                    <c:choose>
                                        <c:when test="${(leftNav eq 2) or (collectorList.contains(article.articleId))}">
                                            <a style="margin-left: 15%;cursor: pointer;color:rgb(255,0,0)"
                                               onclick="return collect(this,${leftNav})">
                                        <span class="glyphicon glyphicon-star-empty"
                                              style="color:rgb(255,0,0)"></span>已收藏
                                            </a>
                                            <input type="hidden" name="isCollect"
                                                   value="${user.userId}@${article.articleId}@T">
                                        </c:when>
                                        <c:otherwise>
                                            <a style="margin-left: 15%;cursor: pointer;color:rgb(46,100,148)"
                                               onclick="return collect(this,${leftNav})">
                                        <span class="glyphicon glyphicon-star-empty"
                                              style="color:rgb(46,100,148)"></span>收藏
                                            </a>
                                            <input type="hidden" name="isCollect"
                                                   value="${user.userId}@${article.articleId}@F">
                                        </c:otherwise>
                                    </c:choose>
                                    <a id="comment${article.articleId}" style="margin-left: 20%;cursor: pointer"
                                       onclick="showComment(this)">
                                        <span class="glyphicon glyphicon-comment" style="color:rgb(46,100,148)"></span>
                                        评论(${article.commentCount})
                                    </a>
                                    <c:choose>
                                        <c:when test="${(leftNav eq 3) or (likerList.contains(article.articleId))}">
                                            <a style="margin-left: 23%;cursor: pointer;color:rgb(255,0,0)"
                                               onclick="praise(this,${leftNav})">
                                        <span class="glyphicon glyphicon-thumbs-up"
                                              style="color:rgb(255,0,0)"></span>
                                                    ${article.likeNum}
                                            </a>
                                            <input type="hidden" name="isLike"
                                                   value="${user.userId}@${article.articleId}@T">
                                        </c:when>
                                        <c:otherwise>
                                            <a style="margin-left: 23%;cursor: pointer;color:rgb(46,100,148)"
                                               onclick="praise(this,${leftNav})">
                                        <span class="glyphicon glyphicon-thumbs-up"
                                              style="color:rgb(46,100,148)"></span>
                                                    ${article.likeNum}
                                            </a>
                                            <input type="hidden" name="isLike"
                                                   value="${user.userId}@${article.articleId}@F">
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                                <div class="share_comment" style="display: none;">
                                    <hr/>
                                    <form method="post" action="#" enctype="multipart/form-data"
                                          onsubmit="return false">
                                        <input type="hidden" name="userName" value="${user.name}">
                                        <img src="${user.headPictureUrl.substring(user.headPictureUrl.lastIndexOf("/head/"))}"
                                             width="30px" height="30px"
                                             style="display: inline;margin: 0.5% 1% 1% 2%;">
                                        <input type="text" name="comment" style="width: 60%;"
                                               maxlength="100"
                                               autocomplete="off">
                                        <button type="button" class="btn btn-primary btn-danger"
                                                onclick="commentShare(this,'${user.userId}','${article.articleId}','${outStatus.index}')">
                                            评论
                                        </button>
                                    </form>
                                    <div class="commentList">
                                        <c:forEach items="${article.commentList}" var="comment" varStatus="inStatus">
                                            <hr style="display: block;margin: 2px 0px 2px"/>
                                            <c:choose>
                                                <c:when test="${comment.commentUser.userId.equalsIgnoreCase(user.userId) or article.sharedUser.userId.equalsIgnoreCase(user.userId)}">
                                                    <div style="display: block" name="curComment"
                                                         onmouseover="showCommentDelete('${outStatus.index}','${inStatus.index}','show')"
                                                         onmouseout="showCommentDelete('${outStatus.index}','${inStatus.index}','close')">
                                                        <img src="${comment.commentUser.headPictureUrl.substring(comment.commentUser.headPictureUrl.lastIndexOf("/head/"))}"
                                                             width="30px" height="30px"
                                                             style="margin: 0.5% 1% 1% 2%;display: inline"/>
                                                        <p style="color: red;font-size: 10px;display: inline">${comment.commentUser.name}： </p>
                                                        <p style="display: inline">${comment.content}</p>
                                                        <small style="display: block;margin-left: 8%">${comment.commentTime}</small>
                                                        <a id="deleteComment${outStatus.index}${inStatus.index}"
                                                           style="cursor:pointer;display: none;float:right;margin-top: -25px;margin-right: 35px;font-style: italic;"
                                                           onclick="deleteComment(this,'${comment.commentId}')">删除</a>
                                                    </div>
                                                </c:when>
                                                <c:otherwise>
                                                    <div style="display: block">
                                                        <img src="${comment.commentUser.headPictureUrl.substring(comment.commentUser.headPictureUrl.lastIndexOf("/head/"))}"
                                                             width="30px" height="30px"
                                                             style="margin: 0.5% 1% 1% 2%;display: inline"/>
                                                        <p style="color: red;font-size: 10px;display: inline">${comment.commentUser.name}： </p>
                                                        <p style="display: inline">${comment.content}</p>
                                                        <small style="display: block;margin-left: 8%">${comment.commentTime}</small>
                                                    </div>
                                                </c:otherwise>
                                            </c:choose>
                                        </c:forEach>
                                        <hr style="margin: 2px 0px 2px"/>
                                    </div>
                                </div>
                            </div>
                        </c:if>
                    </c:forEach>
                </div>
            </div>
            <!-- 右边的界面 -->
            <div class="col-md-4 column" style="width: 20%;margin-left: -1%;">
                <div class="W_person_info">
                    <div class="cover" id="skin_cover_s"
                         style="background-image:url(https://img.t.sinajs.cn/t5/skin/public/profile_cover/001_s.jpg)">
                        <div class="headPic">
                            <a href="/in/home?leftNav=5" title="${user.name}">
                                <img class="img-circle"
                                     src="${user.headPictureUrl.substring(user.headPictureUrl.lastIndexOf("/head/"))}"
                                     width="60" height="60"
                                     alt="${user.name}">
                            </a>
                        </div>
                        <div class="headPicName"
                             style="margin-left: ${-3.5*user.name.replaceAll('[^x00-xff]','xx').length()+26}px;">
                            <a href="/in/home?leftNav=5" title="${user.name}">${user.name}</a>
                        </div>
                    </div>
                </div>
            </div>
        </c:when>
        <c:when test="${leftNav eq 10086}">
            <div class="root_manager col-md-9 column" style="height: ${56+76*userList.size()}px;">
                <table class="table table-striped table-hover table-bordered table-condensed">
                    <thead>
                    <tr>
                        <th style="width: 50px;height: 50px;"> 编号</th>
                        <th style="width: 120px;height: 50px;"> 帐号</th>
                        <th style="width: 150px;height: 50px;"> 昵称</th>
                        <th style="width: 120px;height: 50px;"> 邮箱</th>
                        <th style="width: 80px;height: 50px;"> 地址</th>
                        <th style="width: 120px;height: 50px;"> 简介</th>
                        <th style="width: 100px;height: 50px;"> 生日</th>
                        <th style="width: 100px;height: 50px;"> 注册时间</th>
                        <th style="width: 100px;height: 50px;text-align: center"> 允许分享</th>
                    </tr>
                    </thead>
                    <tbody style="overflow-y:auto;">
                    <c:forEach items="${userList}" var="curUser" varStatus="statu">
                        <tr>
                            <td>${statu.count}</td>
                            <td>${curUser.userId}</td>
                            <td>${curUser.name}</td>
                            <td>${curUser.mail}</td>
                            <c:choose>
                                <c:when test="${curUser.address.length()>0}">
                                    <td>${curUser.address}</td>
                                </c:when>
                                <c:otherwise>
                                    <td style="color:red;">无</td>
                                </c:otherwise>
                            </c:choose>
                            <c:choose>
                                <c:when test="${curUser.introduction eq null or curUser.introduction.length()<=0}">
                                    <td style="color:red;">无</td>
                                </c:when>
                                <c:when test="${curUser.introduction.trim().length()<20}">
                                    <td title="${curUser.introduction}">${curUser.introduction.substring(0,curUser.introduction.length()>=20?20:curUser.introduction.length())}</td>
                                </c:when>
                                <c:otherwise>
                                    <td title="${curUser.introduction}">${curUser.introduction.substring(0,20)}...</td>
                                </c:otherwise>
                            </c:choose>
                            <td>${curUser.birthday}</td>
                            <td>${curUser.registerDate}</td>
                            <td style="text-align: center">${curUser.isAllowShare.equalsIgnoreCase("T")?"允许":"禁止"}
                                <button class="btn btn-mini btn-inverse" style="cursor: pointer;" title="点击改变用户分享状态"
                                        onclick="reverseAllowShare('${curUser.userId}',this)">
                                        ${curUser.isAllowShare.equalsIgnoreCase("T")?"禁止":"允许"}
                                </button>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </c:when>
        <c:when test="${leftNav eq 1008611}">
            <div class="root_manager col-md-9 column">
                <div style="margin-left: 50%;">
                    <input type="text" placeholder="请输入要添加的关键词" id="newKeyword">
                    <button type="button" class="btn btn-info" onclick="addKeyword(this)">添加</button>
                </div>
                <div style="margin-top: 2%;margin-left: 10%;width: 65%;height: ${(25+39*keywordList.size())<300?300:(25+39*keywordList.size())}">
                    <table class="table table-hover table-bordered">
                        <tbody id="keywordTable">
                        <c:forEach items="${keywordList}" var="keyword" varStatus="statu">
                            <tr ondblclick="editKeyword(this)" title="双击编辑关键词">
                                <td id="index${statu.count}" width="50px">${statu.count}</td>
                                <td>${keyword}
                                    <span class="badge" style="float:right;" onclick="deleteKeyword(this)" title="点击删除">
                                            <span class="glyphicon glyphicon-remove"></span>
                                        </span>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
        </c:when>
        <c:otherwise>
        <div class="profile_pinfo" id="pl_content_account">
            <div class="infoImage">
                <form action="/article/updateHead" method="post" enctype="multipart/form-data">
                    <input type="hidden" name="userId" value="${user.userId}">
                    <a title="上传/修改头像" onclick="headImage_click()">
                        <img class="img-circle"
                             src="${user.headPictureUrl.substring(user.headPictureUrl.lastIndexOf("/head/"))}"
                             width="200" height="200" style="margin-left: 72%;margin-top: 5%;cursor: pointer;"
                             alt="${user.name}">
                    </a>
                    <input id="loadHead" type="file" name="img"
                           accept="image/png,image/jpeg,image/jpg" value="选择"
                           style="display: none" onchange="submitHead_click()"/>
                    <p alt="${user.name}" id="nameOfUnderHeadPic" style="font-size: 180%;margin-top: 1%;
                            margin-left: ${user.name.replaceAll('[^x00-xff]','xx').length()<=10?75:75-(user.name.replaceAll('[^x00-xff]','xx').length()-10)/2}%;
                            width: ${user.name.replaceAll('[^x00-xff]','xx').length()<=10?150:150+(user.name.replaceAll('[^x00-xff]','xx').length()-10)*25/2}px;
                            background-color: wheat;text-align: center;"> ${user.name}</p>
                    <input id="submitHead" type="submit" style="display: none"/>
                </form>
            </div>
            <div class="infoblock" node-type="base_out">
                <form class="info_title">
                    <fieldset class="S_line2">
                        <legend class="S_txt1">基本信息</legend>
                        <a id="edit" style="margin: -31px 50px;float: right;position: relative;cursor: pointer;"
                           onclick="editPersonMes(this)">编辑</a>
                    </fieldset>
                </form>
                <div id="primaryView" node-type="base_view">
                    <div class="pf_item">
                        <div class="label S_txt2">登录名</div>
                        <div class="con">${user.userId.replaceAll("(\\d{3})\\d{4}(\\d{4})","$1****$2")}
                            <a data-toggle="modal" data-target="#updatePsw" href="#">修改密码</a>
                        </div>
                    </div>
                    <div class="pf_item">
                        <div class="label S_txt2">昵&nbsp;&nbsp;称</div>
                        <c:choose>
                            <c:when test="${user.name eq null}">
                                <div id="viewNickName" class="con">
                                    <a style="cursor: pointer;" onclick="edit_click()">立即填写</a> 自己的昵称
                                </div>
                            </c:when>
                            <c:otherwise>
                                <div id="viewNickName" class="con" node-type="nickname_view">${user.name}</div>
                            </c:otherwise>
                        </c:choose>
                    </div>
                    <div class="pf_item">
                        <div class="label S_txt2">所在地</div>
                        <c:choose>
                            <c:when test="${user.address eq null}">
                                <div id="viewAddress" class="con">
                                    <a style="cursor: pointer;" onclick="edit_click()">立即填写</a> 选择自己的所在地
                                </div>
                            </c:when>
                            <c:otherwise>
                                <div id="viewAddress" class="con" node-type="city_view">${user.address}</div>
                            </c:otherwise>
                        </c:choose>
                    </div>
                    <div class="pf_item">
                        <div class="label S_txt2"> 性&nbsp;&nbsp;别</div>
                        <c:choose>
                            <c:when test="${user.sex eq null}">
                                <div id="viewSex" class="con">
                                    <a style="cursor: pointer;" onclick="edit_click()">立即填写</a> 选择自己的性别
                                </div>
                            </c:when>
                            <c:otherwise>
                                <div id="viewSex" class="con" node-type="sex_view">${user.sex}</div>
                            </c:otherwise>
                        </c:choose>
                    </div>
                    <div class="pf_item">
                        <div class="label S_txt2">生日</div>
                        <c:choose>
                            <c:when test="${user.birthday eq null}">
                                <div id="viewBirthday" class="con">
                                    <a style="cursor: pointer;" onclick="edit_click()">立即填写</a> 选择自己的生日
                                </div>
                            </c:when>
                            <c:otherwise>
                                <div id="viewBirthday" class="con" node-type="birth_view">${user.birthday}</div>
                            </c:otherwise>
                        </c:choose>
                    </div>
                    <div class="pf_item">
                        <div class="label S_txt2">简介</div>
                        <c:choose>
                            <c:when test="${(user.introduction eq null) or (user.introduction.length() eq 0)}">
                                <div id="viewIntroduction" class="con" node-type="desc_view"><a
                                        style="cursor: pointer;"
                                        onclick="edit_click()">立即填写</a>&nbsp;自己的个人介绍,让大家快速了解真实的你
                                </div>
                            </c:when>
                            <c:otherwise>
                                <div id="viewIntroduction" class="con"
                                     node-type="desc_view">${user.introduction}</div>
                            </c:otherwise>
                        </c:choose>
                    </div>
                    <div class="pf_item">
                        <div class="label S_txt2">注册时间</div>
                        <div class="con" node-type="desc_view">${user.registerDate}</div>
                    </div>
                </div>
                <div id="editView" node-type="base" style="display: none;">
                    <form method="post" action="#" enctype="multipart/form-data"
                          onsubmit="return false">
                        <div class="pf_item">
                            <div class="label S_txt2">登录名</div>
                            <div class="con">${user.userId.replaceAll("(\\d{3})\\d{4}(\\d{4})","$1****$2")}
                                <a data-toggle="modal" data-target="#updatePsw" href="#">修改密码</a>
                            </div>
                            <input type="hidden" id="userId" value="${user.userId}">
                        </div>
                        <div class="pf_item">
                            <div class="label S_txt2"><span class="W_error">*</span>昵&nbsp;&nbsp;称</div>
                            <div class="con">
                                <input minlength="1" max="8" id="nickname" name="nickname" class="W_input"
                                       value="${user.name}" placeholder="输入昵称" title="昵称最少1个字符，最多18个字符">
                            </div>
                        </div>
                        <div class="pf_item">
                            <div class="label S_txt2"><span class="W_error">*</span>所在地</div>
                            <div class="con">
                                <div class="input_sel" node-type="cityselector">
                                    <span>
                                    <select name="province" id="province" node-type="province" init_value="400">
                                            <option>保密</option><option value="34">安徽</option><option
                                            value="11">北京</option><option
                                            value="50">重庆</option><option
                                            value="35">福建</option><option value="62">甘肃</option><option
                                            value="44">广东</option><option
                                            value="45">广西</option><option value="52">贵州</option><option
                                            value="46">海南</option><option
                                            value="13">河北</option><option value="23">黑龙江</option><option
                                            value="41">河南</option><option
                                            value="42">湖北</option><option value="43">湖南</option><option
                                            value="15">内蒙古</option><option
                                            value="32">江苏</option><option value="36">江西</option><option
                                            value="22">吉林</option><option
                                            value="21">辽宁</option><option value="64">宁夏</option><option
                                            value="63">青海</option><option
                                            value="14">山西</option><option value="37">山东</option><option
                                            value="31">上海</option><option
                                            value="51">四川</option><option value="12">天津</option><option
                                            value="54">西藏</option><option
                                            value="65">新疆</option><option value="53">云南</option><option
                                            value="33">浙江</option><option
                                            value="61">陕西</option><option value="71">台湾</option><option
                                            value="81">香港</option><option
                                            value="82">澳门</option><option value="400">海外</option><option
                                            value="100">其他</option>
                                    </select>    &nbsp;</span>
                                </div>
                            </div>
                        </div>
                        <div class="pf_item">
                            <div class="label S_txt2"><span class="W_error">*</span>性&nbsp;&nbsp;别</div>
                            <div class="con">
                                <div class="input_check" node-type="gender_selector">
                                    <span class="rsp">
                                        <label for="man_radio">
                                            <input id="man_radio" name="gender" type="radio" value="m" class="W_radio"
                                                   checked="checked">男
                                        </label>
                                    </span>
                                    <span class="rsp">
                                        <label for="woman_radio">
                                            <input id="woman_radio" name="gender" type="radio" value="f"
                                                   class="W_radio">女
                                        </label>
                                    </span>
                                    <div class="status" node-type="gender_tip" style="display: none;"></div>
                                </div>
                            </div>
                        </div>
                        <div class="pf_item">
                            <div class="label S_txt2" node-type="birth_label">生日</div>
                            <div class="con">
                                <input type="date" id="birthday" value="${user.birthday}">
                            </div>
                        </div>
                        <div class="pf_item">
                            <div class="label S_txt2" node-type="desc_label">简介</div>
                            <div class="con">
                                <textarea name="mydesc" id="introduction" maxlength="100"
                                          style="width: 200px;height: 150px;margin-bottom: 10px;"></textarea>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    </c:otherwise>
    </c:choose>
</div>
<!-- 修改密码框-->
<div id="updatePsw" class="modal fade" tabindex="-1">
    <div class="modal-dialog" id="modal">
        <div class="modal-content">
            <div class="modal-body">
                <!-- 模式框右上角的关闭按钮 -->
                <button class="close" data-dismiss="modal" id="close" onclick="reset('updatePswForm')">
                    <span class="glyphicon glyphicon-remove"></span>
                </button>
            </div>
            <div class="modal-title">
                <h1 class="text-center">修改密码</h1>
            </div>
            <div class="modal-body">
                <form class="form-group" id="updatePswForm" action="#" method="post" enctype="multipart/form-data"
                      onsubmit="return false">
                    <div class="form-group">
                        <label for="oldPsw">原密码：</label>
                        <input class="form-control" type="password" name="userId" id="oldPsw"
                               placeholder="输入原来的密码">
                    </div>
                    <div class="form-group">
                        <span class="glyphicon glyphicon-lock"></span>
                        <label for="newPsw1">新密码：</label>
                        <input class="form-control" type="password" name="password" id="newPsw1"
                               placeholder="至少6位且不多于20位的字母或数字">
                    </div>
                    <div class="form-group">
                        <span class="glyphicon glyphicon-lock"></span>
                        <label for="newPsw2">再次输入新密码：</label>
                        <input class="form-control" type="password" name="confirmPassword" id="newPsw2"
                               placeholder="至少6位且不多于20位的字母或数字">
                    </div>
                    <div class="text-right">
                        <button class="btn btn-primary" type="button" id="submit" onclick="updatePassword()">修改
                        </button>
                        <button class="btn btn-danger" data-dismiss="modal" onclick="reset('registerForm')">取消</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</body>
</html>
